package com.basic.tools.codegen.service.impl;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import com.basic.tools.codegen.entity.*;
import com.basic.tools.codegen.mapper.GenTableColumnMapper;
import com.basic.tools.codegen.mapper.GenTableMapper;
import com.basic.tools.codegen.service.IGenTableService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * 业务 服务层实现
 */
@Service
public class GenTableServiceImpl implements IGenTableService
{
    private static final Logger log = LoggerFactory.getLogger(GenTableServiceImpl.class);

    @Autowired
    private GenTableMapper genTableMapper;

    @Autowired
    private GenTableColumnMapper genTableColumnMapper;



    /**
     * 查询业务列表
     * 
     * @param genTable 业务信息
     * @return 业务集合
     */
    @Override
    public List<GenTable> selectGenTableList(GenTable genTable)
    {
        return genTableMapper.selectGenTableList(genTable);
    }

    /**
     * 查询据库列表
     * 
     * @param genTable 业务信息
     * @return 数据库表集合
     */
    @Override
    public List<GenTable> selectDbTableList(GenTable genTable)
    {
        return genTableMapper.selectDbTableList(genTable);
    }

    @Override
    public List<GenTable> selectDbTableListByNames(String[] tableNames) {
        return null;
    }

    @Override
    public List<GenTable> selectGenTableAll() {
        return null;
    }

    @Override
    public GenTable selectGenTableById(Long id) {
        return null;
    }

    @Override
    public void updateGenTable(GenTable genTable) {

    }

    @Override
    public void deleteGenTableByIds(String ids) {

    }

    @Override
    public void importGenTable(List<GenTable> tableList, String operName) {

    }

    @Override
    public Map<String, String> previewCode(Long tableId) {
        return null;
    }

    @Override
    public byte[] downloadCode(String tableName) {
        return new byte[0];
    }

    @Override
    public void generatorCode(String tableName) {

    }

    @Override
    public void synchDb(String tableName) {

    }

    @Override
    public byte[] downloadCode(String[] tableNames) {
        return new byte[0];
    }

    @Override
    public void validateEdit(GenTable genTable) {

    }


}